package com.c.ctgproject.ui.files

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.awaitSync
import com.c.ctgproject.utils.launch

class FileImageVideoViewModel :BaseViewModel(){
    private val mResult = MutableLiveData<String>()
    val result: LiveData<String> get() = mResult

    fun getInPhoto(carID:String){
        launch {
            mResult.value=ApiMethods.retrofit.fileManagerInPhotos(carID).awaitSync()
        }
    }

    private val mVideoResult = MutableLiveData<String>()
    val videoResult: LiveData<String> get() = mVideoResult

    fun getInVideo(carID:String){
        launch {
            mVideoResult.value=ApiMethods.retrofit.fileManagerInVideo(carID).awaitSync()
        }
    }

}